<template>
  <input v-model="model" @input="filterNumber" :title="title" />
  <button @click="handClick">点击</button>
</template>
<script setup>
const model = defineModel({ required: true })
const title = defineModel('title', { default: 'title from parent...' })
const handClick = () => {
  console.log(model.value)
  model.value++
}
const filterNumber = () => {
  model.value = model.value.replace(/\D/g, '')
}
</script>
